home *** CD-ROM | disk | FTP | other *** search
/ Programming Languages Suite / ProgramD2.iso / Borland / Borland C++ V5.02 / OWLINC.PAK / HOTKEY.H < prev    next >
C/C++ Source or Header  |  1997-05-06  |  2KB  |  75 lines

  1. //----------------------------------------------------------------------------
  2. // ObjectWindows
  3. // Copyright (c) 1995, 1997 by Borland International, All Rights Reserved
  4. //
  5. //$Revision:   10.6  $
  6. //
  7. // Definition of class THotKey
  8. //----------------------------------------------------------------------------
  9. #if !defined(OWL_HOTKEY_H)
  10. #define OWL_HOTKEY_H
  11.  
  12. #if !defined(OWL_COMMCTRL_H)
  13. # include <owl/commctrl.h>
  14. #endif
  15.  
  16. #if defined(BI_NAMESPACE)
  17. namespace OWL {
  18. #endif
  19.  
  20. // Generic definitions/compiler options (eg. alignment) preceeding the 
  21. // definition of classes
  22. #include <services/preclass.h>
  23.  
  24. //
  25. // class THotKey
  26. // ~~~~~ ~~~~~~~
  27. // THotKey encapsulates the hot-key control, a window that allows the user to 
  28. // enter a combination of keystrokes to be used as a a hot key. 
  29. // [A hot key is a key combination that the user can press to perform an 
  30. // action quickly].
  31. //
  32. class _OWLCLASS THotKey : public TControl {
  33.   public:
  34.     THotKey(TWindow* parent,
  35.             int             id,
  36.             int x, int y, int w, int h,
  37.             TModule*        module = 0);
  38.  
  39.     THotKey(TWindow* parent, int resourceId, TModule* module = 0);
  40.  
  41.     // Set and retrieve the hot key virtual code.
  42.     //
  43.     uint16  GetHotKey();
  44.     void    SetHotKey(uint16 hotKey);
  45.     void    SetHotKey(uint8 vk, uint8 mods);
  46.  
  47.     // Set the invalid key combinations for this control
  48.     //
  49.     void    SetRules(uint16 invalid, uint16 defFlag);
  50.  
  51.   protected:
  52.     // Override TWindow virtual member functions
  53.     //
  54.     char far*    GetClassName();
  55.     uint         Transfer(void* buffer, TTransferDirection direction);
  56.  
  57.   private:
  58.     // Hidden to prevent accidental copying or assignment
  59.     //
  60.     THotKey(const THotKey&);
  61.     THotKey& operator =(const THotKey&);
  62.  
  63.   DECLARE_STREAMABLE(_OWLCLASS, THotKey, 1);
  64. };
  65.  
  66. // Generic definitions/compiler options (eg. alignment) following the 
  67. // definition of classes
  68. #include <services/posclass.h>
  69.  
  70. #if defined(BI_NAMESPACE)
  71. } // namespace OWL
  72. #endif
  73.  
  74. #endif  // OWL_HOTKEY_H
  75.